HL7 v2 to FHIR System API - Implementation Template

(0 reviews)

Developer guide

HL7 v2 to FHIR Developer Guide

This is a developer guide generated from source code comments in the DataWeave modules of this application template. The main.dwl file is the entry point of the HL7 v2 to FHIR converter and a good place to start. It uses adt_a01.dwl and oml_o12.dwl modules based upon the message type.

ModuleDescription
accountMaps the account object.
addressMaps the FHIR address object.
addresstypeMaps the address type object.
adt_a01This module is responsible for converting an ADT-A01 HL7 message into it's equivalent FHIR format.
allergycriticalityMaps the allergy criticality.
allergyintoleranceProduces the FHIR Allergy Intolerance object.
allergyseverityMaps the allergy severity.
allergytypeMaps the allergy type.
appointmentThis module is responsible for converting a SIU-S12 HL7 message into a FHIR Appointment object.
codeableconceptMaps the CodeableConcept object.
conditionMaps the condition object.
contactpointMaps the FHIR contact point object.
contactpointuseMaps the FHIR ContactPointUse object.
contactroleMaps the contact role.
cqMaps the CQ quantity object.
cxMaps the CX quantity object.
deviceProduces the FHIR Device object.
diagnosticreportProduces the FHIR diagnostic report object.
driverlicensenumberMaps the driver license number object.
eiidentifierMaps the EIIdentifier part of a CodeableConcept object.
encounterProduces the FHIR encounter object.
error-response
extendedcompositeidMaps the extended composite ID object.
extendedpersonnameMaps the extended person name object.
extendedtelecommunicationnumberMaps the extended telecommunication number object.
genderMaps the gender object.
identifierMaps the FHIR identifier object.
idtypesMaps the ID type object.
languageMaps the Language object.
locationMaps the FHIR Location object.
mainThis DataWeave file (main.dwl) is the entry point for the HL7 to FHIR converter. You can add a transform and set the source to this file in order to convert a parsed HL7 message to FHIR. Currently it will parse ADT-A01 and OML-O21 HL7 messages. When producing HL7 input messages, often there are line ending problems. HL7 expects \r (carriage return) as the messaage delimiter but \n or other characters are used/added. To get around this you can use this perl command to replace \n with \r characters on the cli. perl -i -p -e 's/\r/\n/' siu-s12.hl7
maritalstatusMaps the marital status object.
nametypeMaps the name type object.
observationMaps a FHIR Observation object.
oml_o21This module is responsible for converting an OML-O21 HL7 message into it's equivalent FHIR format.
orderstatusMaps order status object.
ordertypeMaps the order type object.
oru_r01This module is responsible for converting an ORU_R01 HL7 message into it's equivalent FHIR format.
patientProduces the FHIR patient object.
physicaltypeMaps the PhysicalType object.
practitionerroleProduces the FHIR PractitionerRole object.
priorityMaps the priority object.
procedureMaps the FHIR Procedure object.
provenanceProduces the FHIR provenance object.
quantityMaps the FHIR quantity object.
rangeMaps the FHIR range object.
ratioMaps the FHIR ratio object.
registrystatusMaps the registry status object.
relatedpersonProduces the FHIR related person object.
relationshipMaps the relationship object.
resultstatusMaps the relationship object.
roleMaps the role object.
servicerequestProduces the FHIR service request object.
siu_s12This module is responsible for converting a SIU-S12 HL7 message into it's equivalent FHIR format.
specimenProduces the FHIR Specimen object.
specimenavailabilityMaps the specimen available object.
telecomequipmenttypeMaps the Telecom Equipment Type object.
telecomusecodeMaps the telecom use code object.
utilThis module defines a number of common utility functions.
yes_noMaps yes/no object.

account

Maps the account object.

Source: ./src/main/resources/dw/resources/account.dwl

Functions

fun mapAccount (data, id: String)

This function maps the account object with the provided PID object and ID string.

param data is the PID object.
param id is a string with the ID to use.
return A FHIR Account formatted object or null if no object provided.

(back to top)

address

Maps the FHIR address object.

Source: ./src/main/resources/dw/resources/datatypes/address.dwl

Functions

fun mapAddress (obj)

Maps the provided object to the FHIR address.

param obj is an object with XAD fields that can be mapped to an address. (ORC-22, RXA-28 ...)
return A FHIR formatted Address object.

(back to top)

addresstype

Maps the address type object.

Source: ./src/main/resources/dw/resources/codesystem/addresstype.dwl

Functions

fun mapAddressType (code)

Maps the provided XAD-07 field to the proper address type object.

param code is a XAD-07 field to map.
return An address type object.

(back to top)

adt_a01

This module is responsible for converting an ADT-A01 HL7
message into it's equivalent FHIR format.

Source: ./src/main/resources/dw/resources/adt_a01.dwl

Functions

fun mapA01Message (data: Object)

This function maps the entire A01 message into it's FHIR equivalent.

param data is an object with the parsed ADTA01 message.
_return
An object with the FHIR representation.

(back to top)

allergycriticality

Maps the allergy criticality.

Source: ./src/main/resources/dw/resources/codesystem/allergycriticality.dwl

Functions

fun mapAllergyCriticality (code)

Maps the provided code to the allergy criticality.

param code is a string with the criticality code.
return An AllergyCriticality object.

(back to top)

allergyintolerance

Produces the FHIR Allergy Intolerance object.

Source: ./src/main/resources/dw/resources/allergyintolerance.dwl

Functions

fun mapAllergyIntolerance (pid: Object, al1, id: String)

This function produces the FHIR Allergy Intolerance object with the provided PID and AL1 objects and ID string.

param pid is a PID object.
param al1 is an AL1 object.
param id is a string with the ID to use.
return A FHIR Allergy formatted object.

fun mapAllergyIntolerance (pid: Object, al1, id: String, patientReference)

This function produces the FHIR Allergy Intolerance object with the provided PID and AL1 objects, ID string, and patient reference string.

param pid is a PID object.
param al1 is an AL1 object.
param id is a string with the ID to use.
param patientReference is an optional patient reference to set.
return A FHIR Allergy formatted object.

(back to top)

allergyseverity

Maps the allergy severity.

Source: ./src/main/resources/dw/resources/codesystem/allergyseverity.dwl

Functions

fun mapAllergySeverity (code)

Maps the provided code to the allergy severity.

param code is a string with the severity code.
return An AllergySeverity object.

(back to top)

allergytype

Maps the allergy type.

Source: ./src/main/resources/dw/resources/codesystem/allergytype.dwl

Functions

fun mapAllergyType (code)

Maps the allergy type with the provided code.

param code is a string with the allergy type code.
return An AllergyType object.

(back to top)

appointment

This module is responsible for converting a SIU-S12 HL7
message into a FHIR Appointment object.

Source: ./src/main/resources/dw/resources/appointment.dwl

Functions

fun mapAppointment (id, obj, pid, nte, ais, serviceNte, aig, aip)

Maps the FHIR Appointment object with the provided SCH HL7 segment.

param id is a string with the GUID.
param obj is a SCH segment.
param pid is the PID segment list.
param nte is a list of NTE segments.
param ais is a list of AIS segments.
param serviceNte is a list of NTE segments from the SERVICE node.
param aig is a list of AIG segments.
param aip is a list of AIP segments.
return A FHIR formatted Appointment object.

fun getEndTime (ais)

Gets the end datetime for the appointment with the provided AIS segment.

return a formatted date or null if not possible.

fun mapAppointmentStatus (val)

Maps the provided HL7 SCH-25 value to the appropriate FHIR status value.

param val is the HL7 SCH-25 value.
return the FHIR formatted status value.

fun mapParticipants (obj, pid, ais, aig, aip)

Maps the provided SCH HL7 segment to the participants list for the Appointment object.

param obj is a SCH segment.
param pid is the PID segment list.
param ais is a AIS segment.
param aig is a list of AIG segments.
param ail is a list of AIL segments.
param aip is a list of AIP segments.
return A FHIR formatted list of participant objects.

(back to top)

codeableconcept

Maps the CodeableConcept object.

Source: ./src/main/resources/dw/resources/datatypes/codeableconcept.dwl

Functions

fun mapCodeableConcept (obj)

Maps the provided object into a CodeableConcept object.

param obj is the object to map from.
return A CodeableConcept object.

fun mapCodeableConcept (obj, hasMappingFunct, mappingFunct)

Maps the provided object with the provided mapping function into a CodeableConcept object.

param obj is the object to map from.
param hasMappingFunct is a boolean with true for has a provided mapping function and false for not. If set to true mappingFunct must be a vaild mapping function reference.
param mappingFunct is a function reference with the function to call to provide the mapping. This function definition must take a single argument.
return A CodeableConcept object.

fun mapCodeableConceptDoMapping (obj, hasMappingFunct, mappingFunct)

This function produces the codeable concept mappings. It's broken out into it's own function so it can be called multiple times from mapCodeableConcept.

param obj is the object to map from.
param hasMappingFunct is a boolean with true for has a provided mapping function and false for not. If set to true mappingFunct must be a vaild mapping function reference.
param mappingFunct is a function reference with the function to call to provide the mapping. This function definition must take a single argument.
return A CodeableConcept object.

(back to top)

condition

Maps the condition object.

Source: ./src/main/resources/dw/resources/condition.dwl

Functions

fun mapCondition (data, pid, id)

Maps the condition object with the provided DG1 segment.

param data is a DG1 segment object.
param pid is a PID segment object.
param id is a string with the ID.
return A object with the mapped Condition or null if no object is provided.

fun mapCondition (data, pid, id, subjectRef)

Maps the condition object with the provided DG1 segment.

param data is a DG1 segment object.
param pid is a PID segment object.
param id is a string with the ID.
param subjectRef is a string with the optional subject reference.
return A object with the mapped Condition or null if no object is provided.

fun mapConditionSubject (id, ref)

Maps the condition subject object with the provided information.

param id is a string with the ID.
param ref is a string with the condition reference.
return An condition object.

fun getOnsetDateTime (dt)

Gets the onset datetime formatted as FHIR datetime or null if no field is provided.

param dt is the DG1-05 datetime value.
return A FHIR datetime formatted value or null if nothing is provided.

fun getRecordedDate (dt)

Gets the record datetime formatted as FHIR datetime or null if no field is provided.

param dt is the DG1-19 datetime value.
return A FHIR datetime formatted value or null if nothing is provided.

fun mapConditionIdentifier (data)

Maps the condition identifier with the provided DG1 segment.

param is a DG1 segment object.
return an identifier array or null if no object is provided.

fun mapVerificationStatus (data)

Maps the verification status with the provided DG1 segment.

param is a DG1 segment object.
return an identifier array or null if no object is provided.

(back to top)

contactpoint

Maps the FHIR contact point object.

Source: ./src/main/resources/dw/resources/datatypes/contactpoint.dwl

Functions

fun mapContactPoint (obj)

Maps the ORC-23 object to a FHIR contact point object.

param obj is an ORC-23 object to map.
return A FHIR ContactPoint object or null if no object is provided.

fun mapContactPointSystem (code)

Maps the ContactPoint system code with the provided XTN-03 code.

param code is the XTN-03 code to map.
return A ContactPoint system code.

(back to top)

contactpointuse

Maps the FHIR ContactPointUse object.

Source: ./src/main/resources/dw/resources/codesystem/contactpointuse.dwl

Functions

fun mapContactPointUse (code)

Maps the provided code value to the proper FHIR ContactPointUse object.

param code is a string with the code to map.
return A ContactPointUse obect or null if no field is supplied.

(back to top)

contactrole

Maps the contact role.

Source: ./src/main/resources/dw/resources/codesystem/contactrole.dwl

Functions

fun mapContactRole (code: String)

Maps the contact role with the provided code.

param code is a string with the code to map.
return A ContactRole object.

(back to top)

cq

Maps the CQ quantity object.

Source: ./src/main/resources/dw/resources/datatypes/cq.dwl

Functions

fun mapCQ (cq)

Maps the CQ quantity object with the provided TQ1 TQ1-02 object.

param cq is a TQ1-02 object to map.
return A mapped CQ object.

(back to top)

cx

Maps the CX quantity object.

Source: ./src/main/resources/dw/resources/datatypes/cx.dwl

Functions

fun mapCX (cx)

Maps the CQ quantity object with the provided SPM-31 object.

param cx is a TQ1-02 object to map.
return A mapped CX object.

(back to top)

device

Produces the FHIR Device object.

Source: ./src/main/resources/dw/resources/device.dwl

Functions

fun mapDevice (prt, id)

This function produces the FHIR Device object with the provided ptr object.

param prt is the prt device object.
param id is a string with the ID to use.
return A object with the mapped Device.

(back to top)

diagnosticreport

Produces the FHIR diagnostic report object.

Source: ./src/main/resources/dw/resources/diagnosticreport.dwl

Functions

fun mapDiagnosticReport (orc, obr, obsItem, specimenList, id: String, subjectRef: String)

This function produces the FHIR diagnostic report object with the provided ORC segment.

param orc is the ORC segment.
param obr is the OBR segment.
param obsItem is the list of OBS segment.
param specimenList is the list of specimen segment.
param id is a string with the ID to use.
param subjectRef is a string with the subjectRef to use.
return A FHIR DiagnosticReport formatted object.

fun mapDiagnosticReportResultReference (obs, id: String)

This function produces the FHIR diagnostic report reason reference object with the provided ref and ID strings.

param ref is a string with the reference.
param id is a string with the ID to use.
return A FHIR service request reason request formatted object.

fun mapDiagnosticReportspecimenReference (ref, id: String)

This function produces the FHIR diagnostic report reason reference object with the provided ref and ID strings.

param ref is a string with the reference.
param id is a string with the ID to use.
return A FHIR service request reason request formatted object.

(back to top)

driverlicensenumber

Maps the driver license number object.

Source: ./src/main/resources/dw/resources/datatypes/driverlicensenumber.dwl

Functions

fun mapDriverLicenseNumber (obj)

Maps the driver license number object with the provided PID PID-20 object.

param obj is a PID-20 object.
return A DriverLicenseNumber object.

(back to top)

eiidentifier

Maps the EIIdentifier part of a CodeableConcept object.

Source: ./src/main/resources/dw/resources/datatypes/eiidentifier.dwl

Functions

fun mapEIIdentifier (obj)

Maps the provided object into a CodeableConcept object.

param obj is the object to map from.
return A CodeableConcept object.

(back to top)

encounter

Produces the FHIR encounter object.

Source: ./src/main/resources/dw/resources/encounter.dwl

Functions

fun mapEncounter (data: Object, pv2: Object, pid: Object, id: String)

This function produces the FHIR encounter object with the provided PV1 and PV2 objects.

param data is the PV1 object.
param pv2 is the PV2 object.
param pid is the PID object.
param id is a string with the ID to use.
return A FHIR Encounter formatted object.

fun mapEncounter (data: Object, pv2: Object, pid: Object, id: String, subjectRef)

This function produces the FHIR encounter object with the provided PV1 and PV2 objects.

param data is the PV1 object.
param pv2 is the PV2 object.
param pid is the PID object.
param id is a string with the ID to use.
param subjectRef is an optional string with the subject reference.
return A FHIR Encounter formatted object.

fun mapEncounterClass (pv1_02)

This function creates the Encounter Class object.

param pv1_02 is the PV1-01 object.
return An Encounter Class object.

fun mapEncounterAccount (pid)

Maps the encounter account reference with the provided PID object.

param pid is a PID object.
return An array of patient references or null if none are found.

fun mapLocation (data: Object)

This maps the Encounter location with the provided PV1 object.

param data is the PV1 object.
return A Location object.

fun mapCodeableConceptAdmissionTypes (code)

This function maps the provided code to the appropriate codeableconcept object for Encounter Admission Types. This function is provided as a pointer to mapCodeableConcept.

param code is the PV1-04 CWE-01 value.
return A CodeableConcept object.

fun mapCodeableConceptReadmissionIndicator (code)

This function maps the provided code to the appropriate codeableconcept object for Encounter Readmission Indicator. This function is provided as a pointer to mapCodeableConcept.

param code is the PV1-13 CWE-01 value.
return A CodeableConcept object.

fun mapCodeableConceptEncounterPriority (code)

This function maps the provided code to the appropriate codeableconcept object for Encounter Priority. This function is provided as a pointer to mapCodeableConcept.

param code is the PV2-25 CWE-01 value.
return A CodeableConcept object.

fun mapHopitalization (data: Object)

Maps the PV1 object to the Encounter hospitalization object.

param data is the PV1 object.
return A hospitalization object.

fun mapParticipant (data: Object, pv2: Object)

Maps the PV1 and PV2 objects to the Encounter participant object.

param data is the PV1 object.
param pv2 is the PV2 object.
return A participant object.

fun mapEncounterIdentifier (data: Object)

Maps the PV1 object to the Encounter identifier object.

param data is the PV1 object.
return An identifier object.

fun mapPeriod (obj: Object)

Maps the PV1 object to the Encounter period object.

param data is the PV1 object.
return A period object.

fun mapReasonCode (obj: Object)

Maps the PV1 object to the Encounter reason code list.

param data is the PV1 object.
return An reasson code list.

fun mapLength (obj: Object)

Maps the PV1 object to the Encounter length object.

param data is the PV1 object.
return A length object.

fun mapText (obj: Object)

Maps the PV1 object to the Encounter text object.

param data is the PV1 object.
return A text object.

fun mapEncounterDiagnosis (id, ref)

Maps the encounter diagnosis object with the provided information.

param id is a string with the ID.
param ref is a string with the encounter reference.
return An encounter diagnosis object.

(back to top)

error-response

Source: ./src/main/resources/dw/error-response.dwl

(back to top)

extendedcompositeid

Maps the extended composite ID object.

Source: ./src/main/resources/dw/resources/datatypes/extendedcompositeid.dwl

Functions

fun mapExtendedCompositeID (cx)

Maps the extended composite ID object with the provided cx object.

param cx is a CX object to map.
return An ExtendedCompositeID object.

(back to top)

extendedpersonname

Maps the extended person name object.

Source: ./src/main/resources/dw/resources/datatypes/extendedpersonname.dwl

Functions

fun mapExtendedPersonName (xpn)

Maps the extended person name with the provided XPN object.

param xpn is an XPN object.
return An ExtendedPersonName object or null if xpn is null.

(back to top)

extendedtelecommunicationnumber

Maps the extended telecommunication number object.

Source: ./src/main/resources/dw/resources/datatypes/extendedtelecommunicationnumber.dwl

Functions

fun mapExtendedTelecommunicationNumber (xtn)

Maps the extended telecommunication number with the provided xtn object.

param xtn is the provided object to map.
return An ExtendedTelecommunicationNumber object.

(back to top)

gender

Maps the gender object.

Source: ./src/main/resources/dw/resources/codesystem/gender.dwl

Functions

fun mapGender (code)

Maps the gender with the provided code.

param code is a string with the code to map.
return A Gender object.

(back to top)

identifier

Maps the FHIR identifier object.

Source: ./src/main/resources/dw/resources/datatypes/identifier.dwl

Functions

fun mapIdentifier (cx)

Maps the provided object to the FHIR identifier object.

param cx is the input object to map.
return An identifier object.

(back to top)

idtypes

Maps the ID type object.

Source: ./src/main/resources/dw/resources/codesystem/idtypes.dwl

Functions

fun mapIdTypes (code)

Maps the ID type with the provided code.

param code is a string with the ID type.
return An IdType object.

(back to top)

language

Maps the Language object.

Source: ./src/main/resources/dw/resources/codesystem/language.dwl

Functions

fun mapLanguage (code)

Maps the provided code to a Language object.

param code is a string with the code to map.
return A Language object.

(back to top)

location

Maps the FHIR Location object.

Source: ./src/main/resources/dw/resources/location.dwl

Functions

fun mapLocation (data, id: String)

Maps the FHIR Location object with the provided PV1-03 object.

param data is a PV1-03 object.
param id is a string with the ID.
return A FHIR Location object or null if no object provided.

fun mapLocation (data, id: String, orc, rxa)

Maps the FHIR Location object with the provided PV1-03 object.

param data is a PV1-03 object.
param id is a string with the ID.
param orc is an optional argument with the ORC segment object.
param rxa is an optional argument with the RXA segment object.
return A FHIR Location object or null if no object provided.

fun mapLocationIdentifier (data)

Maps the location identifier and returns an array if object is provided and null if not.

param data is an ORC-21 object.
return An array with the identifier result or null if no object is provided.

(back to top)

main

This DataWeave file (main.dwl) is the entry point for the
HL7 to FHIR converter. You can add a transform and set the
source to this file in order to convert a parsed HL7 message
to FHIR. Currently it will parse ADT-A01 and OML-O21 HL7
messages.

When producing HL7 input messages, often there are line ending
problems. HL7 expects \r (carriage return) as the messaage delimiter
but \n or other characters are used/added. To get around this you
can use this perl command to replace \n with \r characters on
the cli.

perl -i -p -e 's/\r/\n/' siu-s12.hl7

Source: ./src/main/resources/dw/main.dwl

(back to top)

maritalstatus

Maps the marital status object.

Source: ./src/main/resources/dw/resources/codesystem/maritalstatus.dwl

Functions

fun mapMaritalStatus (code: String)

Maps the marital status with the provided code.

param code is a string with the status.
return A MaritalStatus object.

(back to top)

nametype

Maps the name type object.

Source: ./src/main/resources/dw/resources/codesystem/nametype.dwl

Functions

fun mapNameType (code: String)

Maps the name type with the provided code.

param code is a string with the status.
return A NameType object.

(back to top)

observation

Maps a FHIR Observation object.

Source: ./src/main/resources/dw/resources/observation.dwl

Functions

fun mapObservation (data, id)

Maps the provided OBX segment to a FHIR Observation object.

param data is a HL7 OBX object.
param id is a string with the ID.
return A FHIR Observation object.

fun mapObservation (data, id, deviceReference)

Maps the provided OBX segment to a FHIR Observation object.

param data is a HL7 OBX object.
param id is a string with the ID.
param deviceReference is an optional device reference string.
return A FHIR Observation object.

fun mapObservation (data, id, deviceReference, subjectReference)

Maps the provided OBX segment to a FHIR Observation object.

param data is a HL7 OBX object.
param id is a string with the ID.
param deviceReference is an optional device reference string.
param subjectReference is an optional subject reference string.
return A FHIR Observation object.

fun mapObservationSubject (data, id, ref)

Maps the observation subject object with the provided information.

param data is an OBX object.
param id is a string with the ID.
param ref is a string with the observation reference.
return An observation object.

fun mapValueQuantity (data)

Maps the value quantity object with the provided HL7 OBX object.

param data is a HL7 OBX object.
return A FHIR Observation valueQuantity object.

fun mapValueString (data)

Maps the value string field with the provided HL7 OBX object.

param data is a HL7 OBX object.
return A valueString field.

fun mapValueCodeableConcept (data)

Maps the codeable concept value with the provided HL7 OBX object.

param data is a HL7 OBX object.
return A FHIR CodeableConcept object or null if no object is provided.

fun mapValuePeriod (data)

Maps the period value with the provided HL7 OBX object.

param data is a HL7 OBX object.
return A FHIR period object or null if no object is provided.

fun mapValueDateTime (data)

Maps the datetime value with the provided HL7 OBX object.

param data is the HL7 OBX object.
return A datetime value or null if no object is provided.

fun mapValueTime (data)

Maps the time value with the provided HL7 OBX object.

param data is the HL7 OBX object.
return A time value or null if no object is provided.

fun mapValueRatio (data)

Maps the ratio value with the provided HL7 OBX object.

param data is the HL7 OBX object.
return A ratio value object or null.

fun mapValueRange (data)

Maps the range value with the provided HL7 OBX object.

param data is the HL7 OBX object.
return A range value object or null.

fun mapInterpretation (data)

Maps the interpretation array with the provided HL7 OBX object.

param data is the HL7 OBX object.
return An array with the interpretation objects or null.

fun mapObservationInterpretationCode (code)

This function is meant to be passed to mapCodeableConcept and will provide the mapping based upon the provided code.

param code is a string with the code to map.
return an object with the mapped code, or null if not found.

fun mapObservationStatus (code)

This function takes the provided code and maps the observation status (codeableconcept).

param code is a string with the code to map.
return an object with the mapped code, or null if not found.

fun mapObservationIdentifier (val)

Maps the identifier for observation with the provided OBX-21 field.

param val is a string with the OBX-21 field.
return A identifier array or null if no value is provided.

fun mapComponent (data)

Maps the component list with the provided OBX object.

param data is an OBX object.
return A component list or null if no object is provided.

(back to top)

oml_o21

This module is responsible for converting an OML-O21 HL7
message into it's equivalent FHIR format.

Source: ./src/main/resources/dw/resources/oml_o21.dwl

Functions

fun mapO21Message (data: Object)

This function maps the entire O21 message into it's FHIR equivalent.

param data is an object with the parsed OMLO21 message.
_return
An object with the FHIR representation.

(back to top)

orderstatus

Maps order status object.

Source: ./src/main/resources/dw/resources/codesystem/orderstatus.dwl

Functions

fun mapOrderStatus (code)

Maps order status with the provided code.

param code is a string with the code to map.
return An OrderStatus object.

(back to top)

ordertype

Maps the order type object.

Source: ./src/main/resources/dw/resources/codesystem/ordertype.dwl

Functions

fun mapOrderType (code)

Maps the order type with the provided code.

param code is a string with the code to map.
return An OrderType object.

(back to top)

oru_r01

This module is responsible for converting an ORU_R01 HL7
message into it's equivalent FHIR format.

Source: ./src/main/resources/dw/resources/oru_r01.dwl

Functions

fun mapR01Message (data: Object)

This function maps the entireR01 message into it's FHIR equivalent.

param data is an object with the parsed ORUR01 message.
_return
An object with the FHIR representation.

(back to top)

patient

Produces the FHIR patient object.

Source: ./src/main/resources/dw/resources/patient.dwl

Functions

fun mapPatient (pid, pd1, nk1, id: String)

This function produces the FHIR patient object with the provided PID and NK1 objects.

param pid is the PID object.
param pd1 is the PD1 object.
param nk1 is the NK1 object.
param id is a string with the ID to use.
return A FHIR Patient formatted object.

(back to top)

physicaltype

Maps the PhysicalType object.

Source: ./src/main/resources/dw/resources/datatypes/physicaltype.dwl

Functions

fun mapPhysicalType (data)

Maps the PL-01 field to the FHIR PhysicalType object.

param data is the PL-01 field.
return a PhysicalType object or null if no field provided.

(back to top)

practitionerrole

Produces the FHIR PractitionerRole object.

Source: ./src/main/resources/dw/resources/practitionerrole.dwl

Functions

fun mapPractitionerRole (data, id)

Maps the provided PTR segment to a FHIR PractitionerRole object.

param data is a HL7 PTR object.
param id is a string with the ID.
return A FHIR Observation object.

fun mapPractitionerRolePeriod (data)

Maps the practitioner role period with the provided PRT object.

param data is a PRT object.
return A FHIR period object or null if both start and end datetime values are empty.

fun mapPractitionerRoleTelecom (data)

Maps the practitioner role telecom objects with the provided PRT object.

param data is a PRT object.
return A list of FHIR telecom objects or null if none are found.

(back to top)

priority

Maps the priority object.

Source: ./src/main/resources/dw/resources/codesystem/priority.dwl

Functions

fun mapPriority (code)

Map the priority with the provided code.

param code is a string with the code to map.
return A Priority object.

(back to top)

procedure

Maps the FHIR Procedure object.

Source: ./src/main/resources/dw/resources/procedure.dwl

Functions

fun mapProcedure (data, id)

Maps the provided PR1 segment to a FHIR Procedure object.

param data is a HL7 PR1 object.
param id is a string with the ID.
return A FHIR Procedure object.

fun mapProcedure (data, id, subjectRef)

Maps the provided PR1 segment to a FHIR Procedure object.

param data is a HL7 PR1 object.
param id is a string with the ID.
param subjectRef is an optional string with the subject reference.
return A FHIR Procedure object.

fun mapProcedureSubject (ref, id)

Maps the provided reference and ID into a procedure subject object.

param ref is a reference string.
param id is a string with the ID.
return A FHIR Procedure object.

(back to top)

provenance

Produces the FHIR provenance object.

Source: ./src/main/resources/dw/resources/provenance.dwl

Functions

fun mapProvenance (orc, msh, targetRef: String, whoPatientRef: String, whoDeviceRef: String, whoOrganizationRef: String, id: String)

This function produces the FHIR provenance object with the provided ORC segment.

param orc is the ORC segment.
param id is a string with the ID to use.
return A FHIR Provenance formatted object.

(back to top)

quantity

Maps the FHIR quantity object.

Source: ./src/main/resources/dw/resources/datatypes/quantity.dwl

Functions

fun mapCweQuantity (obj)

Maps the provided HL7 object to part of the FHIR quantity object.

param is an object to map.
return an object with part of the quantity object.

(back to top)

range

Maps the FHIR range object.

Source: ./src/main/resources/dw/resources/datatypes/range.dwl

Functions

fun mapSnRange (obj)

Maps the provided HL7 object to part of the FHIR range object.

param is an object to map.
return an object with part of the range object or null if provided obj is null.

(back to top)

ratio

Maps the FHIR ratio object.

Source: ./src/main/resources/dw/resources/datatypes/ratio.dwl

Functions

fun mapSnRatio (obj)

Maps the provided HL7 object to part of the FHIR ratio object.

param is an object to map.
return an object with part of the ratio object or null if the provided obj is null.

(back to top)

registrystatus

Maps the registry status object.

Source: ./src/main/resources/dw/resources/codesystem/registrystatus.dwl

Functions

fun mapRegistryStatus (code)

Maps the registry status with the provided code.

param code is a string with the code to map.
return A RegistryStatus object.

(back to top)

relatedperson

Produces the FHIR related person object.

Source: ./src/main/resources/dw/resources/relatedperson.dwl

Functions

fun mapRelatedPerson (pid: Object, nk1, id)

This function produces the FHIR related person object with the provided PID and NK1 objects, and id string.

param pid is the PID object.
param nk1 is the NK1 object.
param id is a string with the ID to use.
return A FHIR RelatedPerson formatted object.

fun mapRelatedPerson (pid: Object, nk1, id, patientRef)

This function produces the FHIR related person object with the provided PID and NK1 objects, id string and patient reference string.

param pid is the PID object.
param nk1 is the NK1 object.
param id is a string with the ID to use.
param patientRef is an optional patient reference.
return A FHIR RelatedPerson formatted object.

(back to top)

relationship

Maps the relationship object.

Source: ./src/main/resources/dw/resources/codesystem/relationship.dwl

Functions

fun mapRelationship (code)

Maps the relationship with the provided code.

param code is a string with the code to map.
return A Relationship object.

(back to top)

resultstatus

Maps the relationship object.

Source: ./src/main/resources/dw/resources/codesystem/resultstatus.dwl

Functions

fun mapResultStatus (code)

Maps the result status with the provided code.

param code is a string with the code to map.
return A ResultStatus object.

(back to top)

role

Maps the role object.

Source: ./src/main/resources/dw/resources/codesystem/role.dwl

Functions

fun mapRole (code)

Maps the role with the provided code.

param code is a string with the code to map.
return A Role object.

(back to top)

servicerequest

Produces the FHIR service request object.

Source: ./src/main/resources/dw/resources/servicerequest.dwl

Functions

fun mapServiceRequest (orc, id: String)

This function produces the FHIR service request object with the provided ORC segment.

param orc is the ORC segment.
param id is a string with the ID to use.
return A FHIR ServiceRequest formatted object.

fun mapServiceRequest (orc, id: String, subject: String)

This function produces the FHIR service request object with the provided ORC segment, id string and subject string.

param orc is the ORC segment.
param id is a string with the ID to use.
param subject is a reference string with the subject.
return A FHIR ServiceRequest formatted object.

fun mapServiceRequest (orc, obr, tq1, obxList, dg1List, id: String, subject: String)

This function produces the FHIR service request object with the provided ORC segment and optional TQ1 segment.

param orc is the ORC segment.
param obr is an optional OBR segment.
param tq1 is an optional TQ1 segment.
param obxList is an optional OBX object Array.
param dg1List is an optional DG1 object Array.
param id is a string with the ID to use.
param subject is a reference string with the subject.
return A FHIR ServiceRequest formatted object.

fun mapServiceRequestSupportingInfo (ref: String, id: String)

This function produces the FHIR service request supporting info object with the provided ref and ID strings.

param ref is a string with the reference.
param id is a string with the ID to use.
return A FHIR service request supporting info formatted patient object.

fun mapServiceRequestReasonReference (ref: String, id: String)

This function produces the FHIR service request reason reference object with the provided ref and ID strings.

param ref is a string with the reference.
param id is a string with the ID to use.
return A FHIR service request reason request formatted object.

fun mapServiceRequestSpecimen (ref: String, id: String)

This function produces the FHIR service request specimen object with the provided ref and ID strings.

param ref is a string with the reference.
param id is a string with the ID to use.
return A FHIR service request specimen formatted object.

fun mapServiceRequestIdentifier (orc, obr)

Maps the service request identifier with the provided orc and obr segments.

param orc is the ORC segment.
param obr is an optional OBR segment.
return An Array with the service request identifier.

(back to top)

siu_s12

This module is responsible for converting a SIU-S12 HL7
message into it's equivalent FHIR format.

Source: ./src/main/resources/dw/resources/siu_s12.dwl

(back to top)

specimen

Produces the FHIR Specimen object.

Source: ./src/main/resources/dw/resources/specimen.dwl

Functions

fun mapSpecimen (spm, id)

This function produces the FHIR Specimen object with the provided order objects.

param spm is the specimen object.
param id is a string with the ID to use.
return A object with the mapped specimen.

fun mapSpecimen (spm, obr, id)

This function produces the FHIR Specimen object with the provided order objects.

param spm is the specimen object.
param obr is the OBR object.
param id is a string with the ID to use.
return A object with the mapped specimen.

(back to top)

specimenavailability

Maps the specimen available object.

Source: ./src/main/resources/dw/resources/codesystem/specimenavailability.dwl

Functions

fun mapSpecimenAvailability (code)

Maps the role with the provided code.

param code is a string with the code to map.
return A specimen available object.

(back to top)

telecomequipmenttype

Maps the Telecom Equipment Type object.

Source: ./src/main/resources/dw/resources/codesystem/telecomequipmenttype.dwl

Functions

fun mapTelecomEquipmentType (code)

Maps the provided XAD-07 field to the proper Telecom Equipment Type object.

param code is a XTN-03 field to map.
return An telecom equipment type object or null if not found.

(back to top)

telecomusecode

Maps the telecom use code object.

Source: ./src/main/resources/dw/resources/codesystem/telecomusecode.dwl

Functions

fun mapTelecomUseCode (code: String)

Maps the telecom use code with the provided code.

param code is a string with the code to map.
return A TelecomUseCode object.

(back to top)

util

This module defines a number of common
utility functions.

Source: ./src/main/resources/dw/resources/util.dwl

Functions

fun mapGuid (InStr: String)

Generates a GUID with the provided string. This is helpful because the GUID generated is predictable.

param InStr is the input string to the hash function.
return A string with the predictable hashed value.

fun toString (data)

Converts anything to a JSON string representation. Note that if you are serializing an object datetime fields may have local timezone information so this can cause issues with repeatability for munit tests.

param data is the data type to convert to JSON.
return A JSON formatted string of the provided variable.

fun hl7ConvertDateTime (timeStr)

Converts a HL7 datetime string to the expected datetime string.

param timeStr is a HL7 datetime string formatted YYYYMMDDHHMMSS.
return A timestamp string formatted YYYY-MM-DDTHH:MM:SS.000Z.

fun hl7ConvertDate (dateStr)

Converst a HL7 date to date string.

param dateStr is a HL7 date string formatted YYYYMMDD.
return A date string formatted YYYY-MM-DD.

fun removeNull (arr: Array)

Removes all null items from an array.

param arr is an array.
return An array with null items removed.

fun removeNull (obj: Object)

Removes all null values from an object.

param obj is an object.
return An object with null values removed.

fun clean (obj: Object)

Cleans the provided object of blank strings, null values, empty objects, and empty arrays.

param obj is an Object to clean.
return A cleaned object.

fun clean (arr: Array)

Cleans the provided array of blank strings, null values, empty objects, and empty arrays.

param arr is an Array to clean.
return A cleaned Array.

fun strip (item, key: String)

Recursively strips the provided key name from any objects in the provided item.

param item is an value.
param key is a String with the object key name to strip.
return The provided value with any instances of the key removed.

fun toEpochSeconds (str)

Converts the provided HL7 datetime string and converts it to a number with the number of seconds since epoch.

param str is a HL7 datetime string.
return A number with number of seconds since epoch.

fun fromEpochSeconds (seconds)

Converts the provided datetime as a number with seconds since epoch into the FHIR formatted datetime string.

param seconds is a number with the seconds since epoch.
return A string with the FHIR formatted datetime string.

fun replacePair (obj: Object, key: String, val)

Replaces a key value pair in an object with the provided object and key value set.

param obj is an object to replace in.
param key is a string to match on.
param val is the value to replace with.
return An object with the replaced pair or null if no object is provided.

fun removeGeneratedIds (data)

Removed any generated IDs such as GUIDS from the payload for testing purposes.

param data is FHIR bundle with the data to remove IDs from.
return The FHIR bundle with generated IDs removed.

fun removeAllInstances (data, fieldNames: Array)

Recursivly removes all instances of the provided fieldName within the provided data structure.

param data is an array or object to remove the field from.
param fieldNames is a array of strings with the field names to remove.
return The data with the field removed.

(back to top)

yes_no

Maps yes/no object.

Source: ./src/main/resources/dw/resources/codesystem/yes_no.dwl

Functions

fun mapYesNo (code)

Maps yesno with the provided code.

param code is a string with the code to map.
return A YesNo object.

(back to top)


Reviews

TypeTemplate
OrganizationMuleSoft
Published by
MuleSoft Solutions
Published onOct 12, 2023
Asset overview

Asset versions for 1.0.x

Asset versions
VersionActions
1.0.9
1.0.8
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1